<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- this is comment -->
    <div id="box">box</div>
    <script>
      const text = document.body.childNodes[0];
      const comment = document.body.childNodes[1];
      const div = document.body.childNodes[3];
      const d = document.nodeType;

      // node.nodeType
      console.log(text.nodeType); // 3
      console.log(comment.nodeType); // 8
      console.log(div.nodeType); // 1
      console.log(d); // 9
    </script>
  </body>
</html>
